#include <bits/stdc++.h>

using namespace std;

class Solution {
public:
	vector<int> findLonely(vector<int>& nums)
	{
		unordered_map<int, int> val2freq;
		for (int num : nums) val2freq[num]++;

		vector<int> res;
		for (auto [val, freq] : val2freq) if (!val2freq.count(val - 1) && !val2freq.count(val + 1) && freq == 1)
				res.emplace_back(val);

		return res;
	}

private:
};

int main()
{
	[[maybe_unused]] Solution solution;
	return 0;
}
